<?php
	$login=$_POST["login"];
	$pass=$_POST["password"];
	include("database.php");
	$requete="
		SELECT *
		FROM users
		WHERE pseudo_users= '$login'
		AND password_users= '$pass'
	";
	$info= mysql_query($requete);
	if (mysql_num_rows($info)>0){
		while($user=mysql_fetch_assoc($info)){
		$id_user=$user["id_users"];
		}
		session_start();
		$_SESSION["id_user"]=$id_user;
		header('Location: index.php');
		exit;

	}else {
		
		echo '
			Your password and/or username is incorrect
			<br /><a href="register.php" title="inscription" class="link">Sign up </a> 
			or <a href="login.php" title="connexion" class="link"> try again</a>
		';
	
	}
	
	
?>
